
<div ng-controller="RepairproCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li><a href="javascript:;">维修报表</a></li>
			<li class="active" ng-hide="menuName">维修项目统计</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/repair/repairpro/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/repair/repairpro/')"><i class="fa fa-star"></i> 收藏 </span>
		
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						维修项目统计查询条件
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()" 
							style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()" 
							style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
                        	<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="group_name" ng-keyup="clearGroup()" name="group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"   ng-keyup="clearGroupBrand()" name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name"  ng-keyup="clearGroupBrandEntity()" name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys"  ng-click='LoadEntityBrands(e)' val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">日期</label>
									<div class="col-lg-8 col-sm-7">
										<select name="search_date"  class="form-control form_params">
											<option value="ro_create_date">工单开单日期</option>
											<option value="for_balance_time">结算日期</option>
											<option value="square_date">结清日期</option>
											<option value="balance_close_time">关单日期</option>
										</select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">从</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range ">
											<input type="text" name="start_date" class="form-control form_params" id="start_date" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'end_date\')||\'2020-10-01\'}'})">
										</div>
									</div>
								</div>
							</div>
                            
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											 <input type="text" name="end_date" class="form-control form_params" id="end_date" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'start_date\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label long_title"
										for="inputEmail1">维修项<br>目代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="labour_code" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">品牌</label>
									<div class="col-lg-8 col-sm-7">
										<select name="brand"  ng-model="ch_brand" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in brands"  value="{{b.brand_code}}">{{b.brand_name}}</option>
										</select>
									</div>
								</div>
							</div>

							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车系</label>
									<div class="col-lg-8 col-sm-7">
										<select name="series" id="series_code" ng-model="$root.ch_serie" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in series" value="{{b.series_code}}">{{b.series_name}}</option>
										</select>
									</div>
								</div>
							</div>

							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车型</label>
									<div class="col-lg-8 col-sm-7">
										<select name="model" id="model_code" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in $parent.models" value="{{b.model_code}}">{{b.model_name}}</option>
										</select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label long_title"
										for="inputEmail1">维修项<br>目名称</label>
									<div class="col-lg-8 col-sm-7">
										<input name="labour_name" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">工种</label>
									<div class="col-lg-8 col-sm-7">
										    <select name="worker_type_name"  class="form-control form_params">
												<option></option>
												<option ng-repeat="b in workList" value="{{b.worker_type_name}}">{{b.worker_type_name}}</option>
											</select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车主姓名</label>
									<div class="col-lg-8 col-sm-7">
										<input name="owner_name" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">工单号</label>
									<div class="col-lg-8 col-sm-7">
										<input name="ro_no" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">收费区分</label>
									<div class="col-lg-8 col-sm-7">
									        <select name="charge_partition_code"  class="form-control form_params">
												<option></option>
												<option ng-repeat="b in charge_partition" value="{{b.charge_partition_code}}">{{b.charge_partition_name}}</option>
											</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车牌号</label>
									<div class="col-lg-8 col-sm-7">
										<input name="license" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">VIN</label>
									<div class="col-lg-8 col-sm-7">
										<input name="vin" type="text"  class="form-control form_params">
									</div>
								</div>
							</div>
							
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">服务顾问</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" name="service_advisor" id="service_advisor" class="form-control select_edit form_params" value=""/>
                                        <ul class="select_list">
                                              <li ng-repeat="b in servicer" val_code="{{b.employee_no}}" val_name="{{b.employee_name}}">{{b.employee_name}}</li>
                                        </ul>  
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label long_title"
										for="inputEmail1">项目维<br>修类型</label>
									<div class="col-lg-8 col-sm-7">
									        <select name="labour_repair_type"  class="form-control form_params">
												<option></option>
												<option ng-repeat="b in repairType" value="{{b.repair_type_name}}">{{b.repair_type_name}}</option>
											</select>
											
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">二次增项</label>
									<div class="col-lg-8 col-sm-7">
									        <select name="add_tag"  class="form-control form_params">
											    <option value=""></option>
												<option value="12781001">是</option>
												<option value="12781002">否</option>
											</select>
									</div>
								</div>
							</div>
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						维修项目统计查询
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="costTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index')" column="index">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('group_name')" column="group_name">事业部</th>
										<th ng-show="!cols.contains('labour_code')" column="labour_code">维修项目代码</th>
										<th ng-show="!cols.contains('labour_name')" column="labour_name">维修项目名称</th>
										<th ng-show="!cols.contains('labour_repair_type')" column="labour_repair_type">项目维修类型</th>
										<th ng-show="!cols.contains('worker_type_name')" column="worker_type_name">工种</th>
										<th qtype='bool' ng-show="!cols.contains('add_tag')" column="add_tag">二次增项</th>
										<th ng-show="!cols.contains('ro_no')" column="ro_no">工单号</th>
										<th ng-show="!cols.contains('license')" column="license">车牌号</th>
										<th ng-show="!cols.contains('order_repair_type')" column="order_repair_type">工单维修类型</th>
										<th qtype='bool' ng-show="!cols.contains('is_rework')" column="is_rework">是否返修</th>
										<th qtype='float' ng-show="!cols.contains('assign_labour_hour')" column="assign_labour_hour">派工工时</th>
										<th ng-show="!cols.contains('charge_partition_name')" column="charge_partition_name">收费区分</th>
										<th ng-show="!cols.contains('model_name')" column="model_name">车型</th>
										<th ng-show="!cols.contains('series_name')" column="series_name">车系</th>
										<th ng-show="!cols.contains('brand_name')" column="brand_name">品牌</th>
										<th ng-show="!cols.contains('engine_no')" column="engine_no">发动机号</th>
										<th ng-show="!cols.contains('vin')" column="vin">VIN</th>
										<th ng-show="!cols.contains('owner_name')" column="owner_name">车主姓名</th>
										<th ng-show="!cols.contains('phone')" column="phone">车主电话</th>
										<th ng-show="!cols.contains('mobile')" column="mobile">车主手机</th>
										<th ng-show="!cols.contains('deliverer')" column="deliverer">送修人</th>
										<th ng-show="!cols.contains('deliverer_phone')" column="deliverer_phone">送修人电话</th>
										<th ng-show="!cols.contains('deliverer_mobile')" column="deliverer_mobile">送修人手机</th>
										<th ng-show="!cols.contains('deliverer_address')" column="deliverer_address">送修人地址</th>
										<th qtype='date' ng-show="!cols.contains('ro_create_date')" column="ro_create_date">进厂时间</th>
										<th qtype='date' ng-show="!cols.contains('for_balance_time')" column="for_balance_time">出厂时间</th>
										<th ng-show="!cols.contains('service_advisor')" column="service_advisor">服务顾问</th>
										<th ng-show="!cols.contains('technician')" column="technician">责任技师</th>
										<th qtype='float' ng-show="!cols.contains('in_mileage')" column="in_mileage">进厂里程数</th>
										<th qtype='float' ng-show="!cols.contains('out_mileage')" column="out_mileage">出厂里程数</th>
										<th qtype='double' ng-show="!cols.contains('lab_sum')" column="lab_sum">应收工时费</th>
										<th qtype='double'ng-show="!cols.contains('discount_sum')" column="discount_sum">工时折扣金额</th>
										<th qtype='double' ng-show="!cols.contains('real_lab_sum')" column="real_lab_sum">实收工时费</th>
										<!-- <th qtype='float' ng-show="!cols.contains('paint_metal_amount')" column="paint_metal_amount">油漆板件数量</th> -->
										<!-- <th ng-show="!cols.contains('trouble_desc')" column="trouble_desc">项目名称备注</th> -->
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in costReports" ng-style="setColor(c.isover)">
										<td ng-show="!cols.contains('index')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" class="">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" class="">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" class="">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('group_name')" class="">{{c.group_name}}</td>
										<td ng-show="!cols.contains('labour_code')" class="">{{c.labour_code}}</td>
										<td ng-show="!cols.contains('labour_name')" class="">{{c.labour_name}}</td>
										
										<td ng-show="!cols.contains('labour_repair_type')" class="">{{c.labour_repair_type}}</td>
										<td ng-show="!cols.contains('worker_type_name')" class="">{{c.worker_type_name}}</td>
										<td ng-show="!cols.contains('add_tag')" class="">{{c.add_tag == null?"否":(c.add_tag=='12781001'?'是':'否') }}</td>
										<td ng-show="!cols.contains('ro_no')" class="">{{c.ro_no}}</td>
										<td ng-show="!cols.contains('license')" class="">{{c.license}}</td>
										<td ng-show="!cols.contains('order_repair_type')" class="">{{c.order_repair_type}}</td>
										<td ng-show="!cols.contains('is_rework')" class="">{{c.is_rework == null?"否":(c.is_rework=='12781001'?'是':'否') }}</td>
										<td ng-show="!cols.contains('assign_labour_hour')" class="">{{c.assign_labour_hour}}</td>
										<td ng-show="!cols.contains('charge_partition_name')" class="">{{c.charge_partition_name}}</td>
										<td ng-show="!cols.contains('model_name')" class="">{{c.model_name}}</td>
										<td ng-show="!cols.contains('series_name')" class="">{{c.series_name}}</td>
										<td ng-show="!cols.contains('brand_name')" class="">{{c.brand_name}}</td>
										<td ng-show="!cols.contains('engine_no')" class="">{{c.engine_no}}</td>
										<td ng-show="!cols.contains('vin')" class="">{{c.vin}}</td>
										<td ng-show="!cols.contains('owner_name')" class="">{{c.owner_name}}</td>
										<td ng-show="!cols.contains('phone')" class="">{{c.phone| mobile}}</td>
										<td ng-show="!cols.contains('mobile')" class="">{{c.mobile| mobile}}</td>
										<td ng-show="!cols.contains('deliverer')" class="">{{c.deliverer}}</td>
										<td ng-show="!cols.contains('deliverer_phone')" class="">{{c.deliverer_phone| mobile}}</td>
										<td ng-show="!cols.contains('deliverer_mobile')" class="">{{c.deliverer_mobile| mobile}}</td>
										<td ng-show="!cols.contains('deliverer_address')" class="">{{c.deliverer_address}}</td>
										<td ng-show="!cols.contains('ro_create_date')" class="">{{c.ro_create_date|date : 'yyyy-MM-dd HH:mm:ss'}}</td>
										<td ng-show="!cols.contains('for_balance_time')" class="">{{c.for_balance_time|date : 'yyyy-MM-dd HH:mm:ss'}}</td>
										<td ng-show="!cols.contains('service_advisor')" class="">{{c.service_advisor}}</td>
										<td ng-show="!cols.contains('technician')" class="">{{c.technician}}</td>
										<td ng-show="!cols.contains('in_mileage')" class="">{{c.in_mileage}}</td>
										<td ng-show="!cols.contains('out_mileage')" class="">{{c.out_mileage}}</td>
										<td ng-show="!cols.contains('lab_sum')" class="">{{c.lab_sum}}</td>
										<td ng-show="!cols.contains('discount_sum')" class="">{{c.discount_sum}}</td>
										<td ng-show="!cols.contains('real_lab_sum')" class="">{{c.real_lab_sum}}</td>
										<!--<td ng-show="!cols.contains('paint_metal_amount')" class="">{{c.paint_metal_amount}}</td>-->
										<!-- <td ng-show="!cols.contains('trouble_desc')" class="">{{c.trouble_desc}}</td> -->
									</tr>
									
									
									<tr class="tbody_last_tr" ng-show="pagination.totalItems > 0">
										<td ng-show="!cols.contains('index')" class=""></td>
										<td ng-show="!cols.contains('entity_code')" class=""></td>
										<td ng-show="!cols.contains('entity_name')" class=""></td>
										<td ng-show="!cols.contains('entity_brand_name')" class=""></td>
										<td ng-show="!cols.contains('group_name')" class=""></td>
										<td ng-show="!cols.contains('labour_code')" class=""></td>
										<td ng-show="!cols.contains('labour_name')" class=""></td>
										<td ng-show="!cols.contains('labour_repair_type')" class=""></td>
										<td ng-show="!cols.contains('worker_type_name')" class=""></td>
										<td ng-show="!cols.contains('add_tag')" class=""></td>
										<td ng-show="!cols.contains('ro_no')" class=""></td>
										<td ng-show="!cols.contains('license')" class=""></td>
										<td ng-show="!cols.contains('order_repair_type')" class=""></td>
										<td ng-show="!cols.contains('is_rework')" class=""></td>
										<td ng-show="!cols.contains('assign_labour_hour')" class=""></td>
										<td ng-show="!cols.contains('charge_partition_name')" class=""></td>
										<td ng-show="!cols.contains('model_name')" class=""></td>
										<td ng-show="!cols.contains('series_name')" class=""></td>
										<td ng-show="!cols.contains('brand_name')" class=""></td>
										<td ng-show="!cols.contains('engine_no')" class=""></td>
										<td ng-show="!cols.contains('vin')" class=""></td>
										<td ng-show="!cols.contains('owner_name')" class=""></td>
										<td ng-show="!cols.contains('phone')" class=""></td>
										<td ng-show="!cols.contains('mobile')" class=""></td>
										<td ng-show="!cols.contains('deliverer')" class=""></td>
										<td ng-show="!cols.contains('deliverer_phone')" class=""></td>
										<td ng-show="!cols.contains('deliverer_mobile')" class=""></td>
										<td ng-show="!cols.contains('deliverer_address')" class=""></td>
										<td ng-show="!cols.contains('ro_create_date')" class=""></td>
										<td ng-show="!cols.contains('for_balance_time')" class=""></td>
										<td ng-show="!cols.contains('service_advisor')" class=""></td>
										<td ng-show="!cols.contains('technician')" class=""></td>
										<td ng-show="!cols.contains('in_mileage')" class=""></td>
										<td ng-show="!cols.contains('out_mileage')" class=""></td>
										<td ng-show="!cols.contains('lab_sum')" class="">{{proSum.sum_lab_sum.value | num3To2}}</td>
										<td ng-show="!cols.contains('discount_sum')" class="">{{proSum.sum_discount_sum.value | num3To2}}</td>
										<td ng-show="!cols.contains('real_lab_sum')" class="">{{proSum.sum_real_lab_sum.value | num3To2}}</td>
									<!-- 	<td ng-show="!cols.contains('paint_metal_amount')" class=""></td>  -->
									<!--	<td ng-show="!cols.contains('trouble_desc')" class=""></td> -->
									</tr>
								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>
						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
</div>

<form id="export_form" action="repairpro/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="维系项目统计"/>
</form>



